import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '设备ID',
    align:"center",
    dataIndex: 'deviceId'
   },
   {
    title: 'android',
    align:"center",
    dataIndex: 'androidId'
   },
   {
    title: '冻结类型，临时冻结，永久冻结',
    align:"center",
    dataIndex: 'freezeType'
   },
   {
    title: '临时冻结结束日期',
    align:"center",
    dataIndex: 'enddate'
   },
   {
    title: '临时冻结开始时间',
    align:"center",
    dataIndex: 'startdate'
   },
   {
    title: '冻结状态，0 正常 1 关闭',
    align:"center",
    dataIndex: 'status'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
  label: '设备ID',
  field: 'deviceId',
  component: 'Input',
  //colProps: { span: 6 },
  },
  {
    label: '冻结状态',
    field: 'status',
    component: 'Input',
    //colProps: { span: 6 },
  },
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '设备ID',
    field: 'deviceId',
    component: 'Input',
  },
  {
    label: 'android',
    field: 'androidId',
    component: 'Input',
  },
  {
    label: '冻结类型，临时冻结，永久冻结',
    field: 'freezeType',
    component: 'Input',
  },
  {
    label: '临时冻结结束日期',
    field: 'enddate',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '临时冻结开始时间',
    field: 'startdate',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '冻结状态，0 正常 1 关闭',
    field: 'status',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  deviceId: {title: '设备ID',order: 0,view: 'text', type: 'string',},
  androidId: {title: 'android',order: 1,view: 'text', type: 'string',},
  freezeType: {title: '冻结类型，临时冻结，永久冻结',order: 2,view: 'text', type: 'string',},
  enddate: {title: '临时冻结结束日期',order: 3,view: 'datetime', type: 'string',},
  startdate: {title: '临时冻结开始时间',order: 4,view: 'datetime', type: 'string',},
  status: {title: '冻结状态，0 正常 1 关闭',order: 5,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}